<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 这是双向绑定的原理 -->
    <div id="app">
        <label for="">
            <!-- 如果打括号需要event的值则使用 $event -->
            <!-- <input type="text" :value="inputData" @input="changeInput"> -->
        </label>
        <div>{{ inputData }}</div>
        <label for="">
            <input type="text" v-model="inputData">
        </label>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data(){
                return {
                    inputData:'我是input的数据'
                }
            },
            methods:{
                changeInput(event){
                    this.inputData = event.target.value
                }
            }
        })
    </script>
</body>
</html>